﻿<?xml version="1.0" encoding="utf-8" ?>
<Recipe Name="NewCustomValidator" xmlns="http://schemas.microsoft.com/pag/gax-core" xmlns:xi="http://www.w3.org/2001/XInclude" Bound="false">
  <DocumentationLinks>
    <Link Kind="Documentation" Caption="Creating Providers" Url="ms-help://MS.VSCC.v80/MS.VSIPCC.v80/ms.EntLib.2007Apr/EnterpriseLibrary/html/10-060-Creating_Providers.htm" />
    <Link Kind="Documentation" Caption="How To: Create an Untyped Provider for an Enterprise Library Application Block" Url="ms-help://MS.VSCC.v80/MS.VSIPCC.v80/ms.EntLib.2007Apr/EnterpriseLibrary/html/10-100-How_To_Create_an_Untyped_Provider_for_an_Enterprise_Library_Application_Block.htm" />
    <Link Kind="NextStep" Caption="Convert Untyped Provider to Typed Provider" Url="recipe://ConvertCustomProvider" />
  </DocumentationLinks>
  <xi:include href="../Common/CommonTypeAliases.xml"
				xpointer="xmlns(gax=http://schemas.microsoft.com/pag/gax-core) xpointer(/gax:Types)" />
  <Caption>New Validator (Untyped)</Caption>
  <Description>Creates an untyped (custom) validator that extends the Validation Application Block.</Description>
  <HostData>
		<CommandBar Menu="ValidationApplicationBlockProject"/>
		<CommandBar Menu="ValidationApplicationBlockFolder"/>
	</HostData>
	<Arguments>
		<xi:include href="../Common/CommonProvider.xml"
				xpointer="xmlns(gax=http://schemas.microsoft.com/pag/gax-core) xpointer(gax:Recipe/gax:Arguments/gax:Argument)" />
		<Argument Name="EnterpriseLibraryReferences">
			<ValueProvider Type="Evaluator" Expression="Microsoft.Practices.EnterpriseLibrary.Common.dll,Microsoft.Practices.ObjectBuilder.dll,Microsoft.Practices.EnterpriseLibrary.Validation.dll" />
		</Argument>
		<Argument Name="ValidatorResources" Type="ProjectItem">
			<ValueProvider Type="ProjectItemByFullNameProvider" 
                     ProjectArgumentName="CurrentProject" 
                     ItemFullName="Resources.resx"
                     />
		</Argument>
	</Arguments>
	<xi:include href="../Common/CommonProvider.xml"
      xpointer="xmlns(gax=http://schemas.microsoft.com/pag/gax-core) xpointer(gax:Recipe/gax:GatheringServiceData)" />
  <Actions>
    <Action   Name="CreateProviderInfo" 
          Type="CreateProviderInfo"
          RuntimeProviderRootType="Validator"
          RuntimeProviderBaseType="ValueValidator"
          ConfigurationClassName="Microsoft.Practices.EnterpriseLibrary.Validation.Configuration.CustomValidatorData"
          NamespacesRuntime="Microsoft.Practices.EnterpriseLibrary.Validation,Microsoft.Practices.EnterpriseLibrary.Validation.Validators,Microsoft.Practices.EnterpriseLibrary.Validation.Configuration"
          DefaultRuntimeImplementationTemplate="$TextTemplateBaseDirectory$DefaultImplementations\CustomValidator.t4"
					GenerateRuntimeConstructors="false"
					>
      <Input Name="Namespace" RecipeArgument="Namespace" />
      <Input Name="ExtendedNamespace" RecipeArgument="ExtendedNamespace" />
      <Input Name="ProviderName" RecipeArgument="ProviderName" />
      <Output Name="ProviderInfo" />
      <Output Name="DefaultRuntimeImplementationTemplate" />
    </Action>
    <xi:include href="../Common/CommonCustomProvider.xml"
      xpointer="xmlns(gax=http://schemas.microsoft.com/pag/gax-core) xpointer(gax:Recipe/gax:Actions/gax:Action) " />
		<Action Name="AddNonNegatedDefaultMessageResource" Type="AddResource"  
				ResourceName="$ProviderName$NonNegatedDefaultMessage" 
				ResourceValue="Gets or sets the non negated default message." 
				RunCustomTool="false">
			<Input Name="Resources" RecipeArgument="ValidatorResources" />
		</Action>
		<Action Name="AddNegatedDefaultMessageResource" Type="AddResource"  
				ResourceName="$ProviderName$NegatedDefaultMessage" 
				ResourceValue="Gets or sets the negated default message.">
			<Input Name="Resources" RecipeArgument="ValidatorResources" />
		</Action>
	</Actions>
</Recipe>
